package com.adapter.demo08;

import java.util.Map;

/**
 * 适配器角色
 */
public class OuterUserInfo implements IUserInfo {
    private IOuterUserBaseInfo baseInfo;
    private IOuterUserOfficeInfo officeInfo;
    private IOuterUserHomeInfo homeInfo;

    private Map<String, String> baseMap ;
    private Map<String, String> officeMap ;
    private Map<String, String> homeMap ;

    public OuterUserInfo(IOuterUserBaseInfo baseInfo, IOuterUserOfficeInfo officeInfo, IOuterUserHomeInfo homeInfo){
        this.baseInfo = baseInfo;
        this.officeInfo = officeInfo;
        this.homeInfo = homeInfo;

        this.baseMap = this.baseInfo.getUserBaseInfo();
        this.officeMap = this.officeInfo.getUserOfficeInfo();
        this.homeMap = this.homeInfo.getHomeInfo();
    }

    public String getUserName() {
        return this.baseMap.get("userName");
    }

    public String getMobileNumber() {
        return this.baseMap.get("mobileNumber");
    }

    public String getOfficeTelNumber() {
        return this.officeMap.get("officeTelNumber");
    }

    public String getJobPosition() {
        return this.officeMap.get("jobPosition");
    }

    public String getHomeTelNumber() {
        return this.homeMap.get("homeTelNumber");
    }

    public String getHomeAddress() {
        return this.homeMap.get("homeAddress");
    }
}
